<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo lang('system_author');?></title>
<link rel="stylesheet" type="text/css" href="<?php echo brd_url('css/admin_style.css')?>" />
<link rel="stylesheet" type="text/css" href="<?php echo brd_url('css/common.css')?>" />
<script type="text/javascript" src="<?php echo brd_url('js/jquery-1.8.1.js')?>"></script>
<script type="text/javascript" src="<?php echo brd_url('js/jquery.tipsy.js')?>"></script>
<script type="text/javascript" src="<?php echo brd_url('js/artDialog/jquery.artDialog.js')?>"></script>
<script type="text/javascript" src="<?php echo brd_url('js/artDialog/plugins/iframeTools.source.js')?>"></script>
<link rel="stylesheet" type="text/css" href="<?php echo brd_url('js/artDialog/skins/default.css?4.1.7')?>"/>
<script type="text/javascript" src="<?php echo brd_url('js/system_set.js')?>"></script>
<script type="text/javascript" src="<?php echo brd_url('js/common.js')?>"></script>
<script type="text/javascript">
var menu_ajaxurl = '<?php echo site_aurl('sys_set/add_admin');?>';
var toggle_url = '<?php echo site_aurl('sys_set/toggle_url');?>';
var delete_url = '<?php echo site_aurl('sys_set/delete_url');?>';
var purview_move_down = '<?php echo site_aurl('sys_set/purview_down');?>';
var purview_move_up = '<?php echo site_aurl('sys_set/purview_up');?>';
//var myurl = '<?php echo get_url();?>';
var myurl = this.location.href;
</script>
</head>
<!--加载头部-->
<?php echo $this->common->submenu();?>
<!--加载左侧-->
<?php echo $this->common->leftmenu();?>
<div class="right">
	<div class="body"> 
	<div class="top_subnav">CMS内容管理平台 ＞ 菜单</div>
		<table class="table">
			<tr>
				<th colspan="8">
					<a href="javascript:system_set.meun_add();" class="add"><em>添加</em></a>
					<!--<a href="javascript:system_set.meun_edit();" class="edit"><em>编辑</em></a>-->
				</th>
			</tr>
			<tr>
				<th>ID</th><th>标题</th><th>控制器</th><th>方法</th><th>排序</th><th>状态</th><th>操作</th>
			</tr>
			<?php foreach($data as $val):?>
			<tr>
				<td><?php echo $val['id'];?></td>
				<td>
				<?php echo str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",$val['depth']).'╠'.$val['title'];?>
				</td>
				<td><?php echo $val['c'];?></td>
				<td><?php echo $val['a'];?></td>
				<td>
				<a href="javascript:system_set.move_up(<?php echo $val['id'];?>)"><img src="<?php echo brd_url('images/i-up.gif');?>"></img></a>
				&nbsp;&nbsp;
				<a href="javascript:system_set.move_down(<?php echo $val['id'];?>)"><img src="<?php echo brd_url('images/i-down.gif');?>"></img></a>
				</td>
			    <td id='tog_static'>
			    <a href="javascript:system_set.toggle_static(<?php echo $val['id'];?>)" 
			    title="<?php  if ($val['static']=='0'):?>设为禁用状态
			    <?php elseif ($val['static']=='1'):?>设为开启状态<?php endif;?>" class="tog_static">
			    <?php echo $val['toggle_static'];?></a></td>
				<td><a href="<?=site_aurl('sys_set/edit_menumes')?>?id=<?php echo $val['id']; ?>" >编辑</a>/
					<a href="javascript:system_set.toggle_delete(<?php echo $val['id'];?>)" >删除</a></td>
			</tr>
			<?php endforeach;?>
		</table>
   </div>
</div>

<table id="add_meun" border='0' cellspacing="0" width="100%" height="100%" style="display:none;">
<tr>
<td width="20%" height="40px">父级菜单</td>
<td align="left" width="30%" height="40px">
<select id="selected" name="selected" style='padding:2px;'>
<option value='0'>独立类别</option>
<?php foreach($data as $k=>$val):?>
<option value=<?php echo $val['id']?> >
<?php echo str_repeat("&nbsp;&nbsp;",$val['depth']),'╠'.$val['title']?>
</option>
<?php endforeach;?>
</select>
</td>
</tr>
<tr><td height="40px">标题</td><td align="left"><input class="input_text_200" type="text" name="meun_title" id="meun_title"/></td></tr>
<tr><td height="40px">控制器</td><td align="left"><input class="input_text_200" type="text" name="meun_control" id="meun_control"/></td></tr>
<tr><td height="40px">方法</td><td align="left"><input class="input_text_200" type="text" name="meun_method" id="meun_method"/></td></tr>
</table>
<!-- 编辑 -->
<table id="edit_meun" border='0' cellspacing="0" width="100%" height="100%" style="display:none;">
<?php echo form_open('admin/test/add_admin');?>
<?php foreach($data as $val):?>
<tr><td height="40px">标题</td><td align="left"><input class="input_text_200" type="text" name="meun_title" value="<?php echo str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;',$val['depth']).'╠'.$val['title'];?>"/></td></tr>
<tr><td height="40px">控制器</td><td align="left"><input class="input_text_200" type="text" name="meun_control" value="<?php echo $val['c'];?>"/></td></tr>
<tr><td height="40px">方法</td><td align="left"><input class="input_text_200" type="text" name="meun_method" value="<?php echo $val['a'];?>"/></td></tr>
<tr align="right"><td colspan="2" height="30px"><input type="submit" value="提交" class="small color blue button"/></td></tr>
<?php endforeach;?>
<?php echo form_close();?>
</table>

</html>
